package priv.ljh.operate.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.annotations.ApiModel;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import priv.ljh.operate.entity.Shopcar;

import java.util.Date;
import java.util.List;

@Mapper
@Repository
@ApiModel("购物车接口类")
public interface ShopCarMapper extends BaseMapper<Shopcar> {

    @Select("select * from shopcar where uid=#{uid}")
    List<Shopcar> getAllcar(@Param("uid") int uid);
    @Insert("insert into shopcar(title,number,img_url,sell_price,market_price,uid) value (#{title},#{number},#{img_url},#{sell_price},#{market_price},#{uid})")
    int insertCar( @Param("title") String title, @Param("number") int number,
                  @Param("img_url") String img_url, @Param("sell_price") String sell_price,
                  @Param("market_price") String market_price,
                  @Param("uid") int uid);
    @Update("update shopcar set number =#{number} where sid=#{sid};")
    int updateCar(@Param("number") int number, @Param("sid") int sid);
    @Delete("delete from shopcar where sid=${sid}")
    int deleteCar(@Param("sid") int sid);
}
